package org.jeecg.modules.innerApi.common.responseDto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

@Data
@ApiModel(description="获取授信额度")
public class CreditRtn extends CommonRtn {
    /**数据结果*/
    @ApiModelProperty(value = "数据结果")
    private CreditRtnData data;

    @Data
    @ApiModel(description="授信额度返回数据")
    public static class CreditRtnData {
        /**剩余授信额度-保留 2 位小数*/
        @ApiModelProperty(value = "剩余授信额度-保留 2 位小数")
        private String sysxed;

        /**总授信额度-保留 2 为小数*/
        @ApiModelProperty(value = "总授信额度-保留 2 为小数")
        private String zsxed;

        @ApiModelProperty(value = "获取时间:yyyy-MM-dd HH:mm:ss")
        private String updateDate;

        public BigDecimal getUsedsxed() {
            return new BigDecimal(zsxed).subtract(new BigDecimal(sysxed));
        }

        @ApiModelProperty(value = "已使用授信额度")
        private BigDecimal usedsxed = BigDecimal.ONE;


    }
}
